// vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import viteSvgIcons from 'vite-plugin-svg-icons'
import path from 'path'
import { ElementPlusResolver, VantResolver } from 'unplugin-vue-components/resolvers'
import Components from 'unplugin-vue-components/vite'
const vite_config_default = defineConfig({
  plugins: [
    vue(),

    viteSvgIcons({
      iconDirs: [path.resolve(process.cwd(), 'src/icons')],
      symbolId: 'icon-[dir]-[name]'
    }),
    Components({
      resolvers: [
        ElementPlusResolver(),
        VantResolver()
      ]
    })
  ],
  base: './',
  resolve: {
    alias: {
      '@': path.resolve('D:\\projects\\fastadmin', 'src'),
      '@assets': path.resolve('D:\\projects\\fastadmin', 'src/assets'),
      '@components': path.resolve('D:\\projects\\fastadmin', 'src/components'),
      '@composables': path.resolve('D:\\projects\\fastadmin', 'src/composables')
    }
  },
  css: {
    preprocessorOptions: {
      scss: {
        additionalData: '@import "@/assets/scss/globalVariable.scss";'
      }
    }
  },
  server: {
    host: '0.0.0.0',
    port: 10086,
    open: false,
    cors: true
  }
})
export {
  vite_config_default as default
}
